home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / compiler / rt / pred.lisp < prev    next >
Encoding:
Text File  |  1991-11-06  |  1.4 KB  |  54 lines

  1. ;;; -*- Package: C; Log: C.Log -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the Spice Lisp project at
  5. ;;; Carnegie-Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of Spice Lisp, please contact
  7. ;;; Scott Fahlman (FAHLMAN@CMUC). 
  8. ;;; **********************************************************************
  9. ;;;
  10. ;;; $Header: pred.lisp,v 1.1 91/02/18 15:08:07 chiles Exp $
  11. ;;;
  12. ;;; This file contains the VM definition of predicate VOPs for the IBM RT.
  13. ;;;
  14. ;;; Written by Rob MacLachlan
  15. ;;; Modified by William Lott and Bill Chiles for the IBM RT.
  16. ;;;
  17.  
  18. (in-package "RT")
  19.  
  20.  
  21.  
  22. ;;;; The Branch VOP.
  23.  
  24. ;;; The unconditional branch, emitted when we can't drop through to the desired
  25. ;;; destination.  Dest is the label where we want to be.
  26. ;;;
  27. (define-vop (branch)
  28.   (:info dest)
  29.   (:generator 5
  30.     (inst b dest)))
  31.  
  32.  
  33.  
  34. ;;;; Conditional VOPs:
  35.  
  36. (define-vop (if-eq)
  37.   (:args (x :scs (any-reg descriptor-reg null))
  38.      (y :scs (any-reg descriptor-reg null)))
  39.   (:conditional)
  40.   (:info target not-p)
  41.   (:policy :fast-safe)
  42.   (:translate eq)
  43.   (:generator 3
  44.     (let ((x-prime (sc-case x
  45.              ((any-reg descriptor-reg) x)
  46.              (null null-tn)))
  47.       (y-prime (sc-case y
  48.              ((any-reg descriptor-reg) y)
  49.              (null null-tn))))
  50.       (inst c x-prime y-prime)
  51.       (if not-p
  52.       (inst bnc :eq target)
  53.       (inst bc :eq target)))))
  54.